package olap4cloud.api;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

import olap4cloud.hadop.statistic.StatisticsTable;
import olap4coud.report.DataReport;

public class StatisticsApi {
	
	private StatisticsTable statisticsTable;
	
	public StatisticsApi(){
		statisticsTable = new StatisticsTable();
	}
	
	public List<DataReport> reportDomainByHour(long hourLong){
		return statisticsTable.reportDomainByHour(hourLong);
	}
	
	public List<DataReport> reportDomainByDate(long dateLong){
		return statisticsTable.reportDomainByDate(dateLong);
	}
	
	public List<DataReport> reportBrowserByHour(long hourLong){
		return statisticsTable.reportBrowserByHour(hourLong);
	}
	
	public List<DataReport> reportBrowserByDate(long dateLong){
		return statisticsTable.reportBrowserByDate(dateLong);
	}
	
	public List<DataReport> reportChannelByHour(long hourLong){
		return statisticsTable.reportChannelByDate(hourLong);
	}
	
	public List<DataReport> reportChannelByDate(long dateLong){
		return statisticsTable.reportChannelByDate(dateLong);
	}
	
	public static void main(String[] args) throws ParseException {
		StatisticsApi stat = new StatisticsApi();
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd:HH");
		long hourTime = simpleDateFormat.parse("2013-04-08:10").getTime();
		for (DataReport d : stat.reportDomainByDate(hourTime)){
			System.out.println(d);
		}
	}

}
